// pages/value/value.js
var app = getApp()
Page({
  data: {
    current:5
  },
  onLoad: function (options) {
    // 页面初始化 options为页面跳转所带来的参数
     //console.log(options.id)
     //console.log(options.typeid)
    var that=this;
    this.setData({
      productId: options.id,
      typeid: options.typeid
    })
      wx.getSystemInfo({//获取滑块的高宽
      success: function (res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight
        });
      }
    });
  },
  onReady: function () {
    // 页面渲染完成
  
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  },
  star1:function(e){
    this.setData({
      current:e.currentTarget.id
    })
  }
  ,
  setValueL: function (e) {
    if (e.detail.value != "") {
      this.setData({
        setValueLs: e.detail.value
      })
    }
  }
  ,
   submitValue: function () {
   
    // console.log(this.data.setValueLs)
    var that = this
    //console.log(that.data.productId)
    wx.request({
      url: app.globalData.allUrl + '/YMGW/orderFormAction/evaluateOrderForm',
      data: {
        // wx.getStorageSync('userInfo').nickName,
        userId: wx.getStorageSync('userid'),
        orderId: that.data.productId,
        evaluateContent: that.data.setValueLs,
        typeId: that.data.typeid,
         evaluateLevel:that.data.current,
      },
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      // header: {}, // 设置请求的 header
      success: function (res) {
        // success
       // console.log(res.data)
        if (res.data == true) {
          wx.switchTab({
            url: '../my/my',
          })
        }
      }
    })
  }
})